package com.atguigu.gmall.product.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.list.SearchAttr;
import com.atguigu.gmall.model.product.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = "service-product",fallback =ProductFeignClientFallBack.class )
public interface ProductFeignClient {
    @GetMapping("/api/product/getBaseCategoryView/{category3Id}")
     BaseCategoryView getBaseCategoryView(@PathVariable("category3Id") Long category3Id);

    @GetMapping("/api/product/getSkuInfo/{skuId}")
    SkuInfo getSkuInfo(@PathVariable("skuId") Long skuId);

    @GetMapping("/api/product/getSaleAttr/{spuId}/{skuId}")
    List<SpuSaleAttr> getSpuSaleAttrAndValue(@PathVariable Long spuId,@PathVariable Long skuId);

    @GetMapping("/api/product/getSkuValueIdsMap/{spuId}")
    Map getSkuValueIdsMap(@PathVariable("spuId") Long spuId);

    @GetMapping("/api/product/getPrice/{skuId}")
    BigDecimal getPrice(@PathVariable Long skuId);

    @GetMapping("/api/product/getBaseCategoryList")
    List<BaseCategoryView> getBaseCategoryList();

    @GetMapping("/api/product/baseTrademark/get/{id}")
    BaseTrademark baseTrademarkById(@PathVariable Long id);

    @GetMapping("/api/product/getSearchAttrList/{skuId}")
    public List<SearchAttr> getSearchAttrList(@PathVariable  Long skuId);

    @GetMapping("/api/product/getBaseAttrInfoAndBaseAttrValue/{skuId}")
    List<SkuAttrValue> getBaseAttrInfoAndBaseAttrValue(@PathVariable Long skuId);

}
